# 1. FaceSet Create
import requests,json

display_name = "网二人脸集合test"
outer_id = "00002"
user_data = "48人，32男生，16女生"
api_secret = "leau1oa7iCtue2TuYD9BMF8oHTnWNFtR"
api_key = "GHo0A7Q9iNYfJayd5xIIIGe0fyOFJkHS"

CreateFace_Url = "https://api-cn.faceplusplus.com/facepp/v3/faceset/create"
payload = {
    'api_key': api_key,
    'api_secret': api_secret,
    'display_name':display_name,
    'outer_id':outer_id,
    'user_data':user_data
}

r = requests.post(CreateFace_Url, params=payload)

r.json()

# 返回对应的人脸合集信息

GetDetail_Url = "https://api-cn.faceplusplus.com/facepp/v3/faceset/getdetail"

payload = {
    'api_key': api_key,
    'api_secret': api_secret,
    'outer_id':outer_id,
}

r = requests.post(GetDetail_Url,params=payload)
r.json()

# 获取人脸合集信息

# 增加人脸
AddFace_url = " https://api-cn.faceplusplus.com/facepp/v3/faceset/addface"

payload = {
    'api_key': api_key,
    'api_secret': api_secret,
    'faceset_token':'e6c82f9c13b6dcab9e3dd2215a908382',
    'face_tokens':'b0407b9e803ebd39d511cd7956fd5bf5',
}
r = requests.post(AddFace_url,params=payload)
r.json()

#Compare Face（对比人脸相似度